// 模板示例
import request from '@/utils/request'
import store from '@/store'
const APP1 = store.state.APP1_API
const APP2 = store.state.APP2_API

/**
 * GET 参数传 url 时
 * */
export function list (params) {
  return request({
    url: `${APP1}/student/list`,
    method: 'GET',
    params: params
  })
}

/**
 * POST 参数传 url 时
 * */
export function save (data) {
  return request({
    url: `${APP1}/student/save`,
    method: 'POST',
    data: data
  })
}

/**
 * POST 导出，响应类型修改
 */
export function exportData (data) {
  return request({
    url: `${APP2}/student/export`,
    method: 'POST',
    data: data,
    responseType: 'blob',
    timeout: 600000
  })
}

/**
 * POST form 表单
 */
export function formData (data) {
  return request({
    url: `${APP2}/student/form`,
    method: 'POST',
    data: data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}
